using System.Data.Entity.ModelConfiguration;
using CodeSaude.Domain.Entities;

namespace CodeSaude.Infrastructure.Data.EntityConfig
{
    public class MenuMap : EntityTypeConfiguration<Menu>
    {
        public MenuMap()
        {
            // Primary Key
            HasKey(t => t.MenuId);

            // Properties
            Property(t => t.NomeMenu)
                .HasMaxLength(90);

            Property(t => t.ImagemMenu)
                .HasMaxLength(90);

            Property(t => t.Action)
                .HasMaxLength(90);

            Property(t => t.Controller)
                .HasMaxLength(90);

            // Table & Column Mappings
            ToTable("Menu");
            Property(t => t.MenuId).HasColumnName("id_menu");
            Property(t => t.NomeMenu).HasColumnName("nome_menu");
            Property(t => t.ImagemMenu).HasColumnName("imagem_menu");
            Property(t => t.Action).HasColumnName("action_menu");
            Property(t => t.Controller).HasColumnName("controller_menu");
            Property(t => t.IdSituacao).HasColumnName("id_situacao");
            Property(t => t.ModuloId).HasColumnName("id_modulo");
        }
    }
}
